package com.hutu.model.resp;

import com.hutu.core.enums.BaseEnum;
import com.hutu.core.enums.system.BusinessStatusEnum;

/**
 * 请求响应数据
 */
public class Response {

    public static ResponseVo success(){
        return new ResponseVo(BusinessStatusEnum.SUCCESS);
    }

    public static ResponseVo success(String message){
        return new ResponseVo(BusinessStatusEnum.SUCCESS.getCode(), message);
    }

    public static ResponseVo success(Object data){
        return new ResponseVo(BusinessStatusEnum.SUCCESS,data);
    }

    public static ResponseVo success(Object data,String token){
        return new ResponseVo(BusinessStatusEnum.SUCCESS,data,token);
    }

    public static ResponseVo success(String message, Object data){
        return new ResponseVo(BusinessStatusEnum.SUCCESS.getCode(),message,data);
    }

    public static ResponseVo error(String message){
        return new ResponseVo(BusinessStatusEnum.ERROR.getCode(), message);
    }

    public static ResponseVo error(){
        return new ResponseVo(BusinessStatusEnum.ERROR);
    }

    public static ResponseVo error(Integer code, String message){
        return new ResponseVo(code,message);
    }

    public static ResponseVo error(BaseEnum e) {
        return new ResponseVo(e);
    }
}
